from matrix import Matrix
from random import Random


def _main():
    def generate_random(random: Random):
        while True:
            yield random.random() * 2 - 1

    matrix = Matrix(10, 5, generate_random(Random()))
    trans = matrix.transposed()

    print(f"原矩阵：")
    print(matrix.format(item_format="5.2f"))
    print()

    print(f"转置矩阵：")
    print(trans.format(item_format="5.2f"))
    print()


if __name__ == "__main__":
    _main()
    